package lesson07.threadpool;

/**
 * 测试自定义线程
 *
 * @author wileda
 * @date 2023/01/15  12:43
 */
public class Demo04 {
    public static void main(String[] args) throws InterruptedException {
        MyThreadPool myThreadPool = new MyThreadPool(5);
        for (int i = 0; i < 100; i++) {
            int taskId = i;
            myThreadPool.submit(() -> {
                System.out.println("线程" + taskId + " " +Thread.currentThread().getName());
            });
        }
    }
}
